package RamdomNumber_Set;

import java.util.*;

public class RamdomNumber_Set {

	public static void main(String[] args) {

		TreeSet<Double> ramdomNumber_TreeSet = new TreeSet<Double>(new Comparator<Double>() {

			@Override
			public int compare(Double o1, Double o2) {
				int num = (int) (o1 - o2);
				return num;

			}
		});

		while (true) {

			Double ramdonNumber = Math.random() * 20;
			ramdomNumber_TreeSet.add(ramdonNumber);
			if (ramdomNumber_TreeSet.size() >= 10) {
				break;
			}

		}

/*		for (Double S : ramdomNumber_TreeSet) {
			System.out.println(S);
		}
		*/
		Iterator<Double> a = ramdomNumber_TreeSet.iterator();
		while(a.hasNext()) {
			double B = a.next();
			System.out.println(B);
		}
		

	}

}
